<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%--
  Created by IntelliJ IDEA.
  User: 董灌磊
  Date: 2024/4/20
  Time: 16:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>房屋租赁合同</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
        }
        .container {
            width: 80%;
            margin: auto;
            background-color: #fff;
            padding: 20px;
            box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
        }
        h1, h2 {
            color: #333;
        }
        .print-btn {
            padding: 10px 20px;
            background-color: #5cb85c;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .print-btn:hover {
            background-color: #4cae4c;
        }
        .signature {
            margin-top: 20px;
        }
    </style>
</head>
<body>

<div class="container">
    <h1>房屋租赁合同</h1>

    <h2>甲方（出租方）信息</h2>
    <p>姓名：${sessionScope.sublet.house.owners.ownername}</p>
    <p>地址：${sessionScope.house.plot.plotname}${sessionScope.house.floormanager.floorname}${sessionScope.house.cell}${sessionScope.house.floornum}${sessionScope.house.houseid}</p>
    <p>联系方式：${sessionScope.sublet.house.owners.ownerphone}</p>

    <h2>乙方（承租方）信息</h2>
    <p>姓名：${sessionScope.sublet.subletname}</p>
    <p>地址：${sessionScope.sublet.subletaddress}</p>
    <p>联系方式：${sessionScope.sublet.subletphone}</p>

    <h2>租赁房屋信息</h2>
    <p>房屋地址：${sessionScope.house.plot.plotname}${sessionScope.house.floormanager.floorname}${sessionScope.house.cell}${sessionScope.house.floornum}${sessionScope.house.houseid}</p>
    <p>房屋面积：${sessionScope.house.totalarea}</p>
    <%--<p>房屋用途：[房屋用途]</p>--%>
    <h2>租赁日期</h2>
    <p>开始租赁：${sessionScope.starttime}</p>
    <p>结束租赁：${sessionScope.endtime}</p>
    <h2>价格说明</h2>
    <p>租金：${sessionScope.sublet.subletmoney}元/月</p>
    <p>押金：${sessionScope.sublet.yamoney}元</p>
    <!-- Additional contract terms go here -->

    <div class="signature">
        <p>甲方签字：___________ 日期：____年____月____日</p>
        <p>乙方签字：___________ 日期：____年____月____日</p>
    </div>

    <button class="print-btn" id="printBtn">打印合同</button>
</div>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        $('#printBtn').click(function() {
            window.print();
        });
    });
</script>

</body>
</html>
